<script src="<?=n_js('charts','echarts')?>"></script>
<style>
#weixin-compete{margin-top:37px;}
#weixin-compete > .left {width:251px;float:left;}
#weixin-compete > .right {width:251px;float:right;}
#weixin-compete > .main {background-color:#FDFDFF;padding:0 10px;margin-left:251px;margin-right:251px;min-height: 1000px;}
#weixin-compete > .main .big-t{margin-top:20px;}
#weixin-compete > .main .big-t .wxinfo{text-align:center;width:113px;padding:10px;background-color: #3E3470;}
#weixin-compete > .main .big-t .wxinfo span{display:block;line-height:40px;color:#fff;font-size:22px;}
#weixin-compete > .main .big-t .wxext{width:570px;vertical-align: top;margin-left:10px;}
#weixin-compete > .main .big-t .wxext a{color:#000;}

#weixin-compete > .main .big-t > div{display:inline-block;}
#weixin-compete > .main .big-t > div > div{display:inline-block;width:49%;}
#weixin-compete > .main .big-t h3{background:url(/weixin/img/comp-bbg.png);width:167px;height:59px;text-align: center;margin-top:10px;}
#weixin-compete > .main .big-t h3 span{font-size:24px;display:block;}
#weixin-compete > .main .big-t .m-num{margin-top:80px;}
#weixin-compete > .main .detail{margin-top:20px;}
#weixin-compete > .main .detail dl{}
#weixin-compete > .main .detail dl dt{width:113px;padding:10px;display:inline-block;background-color:#3E3470;color:#fff;text-align:center;line-height:98px;vertical-align: top;font-size:22px;}
#weixin-compete > .main .detail dl dd{display:inline-block;width:550px;}
#weixin-compete > .main .detail dl dd div{display:inline-block;text-align:center;display:inline-block;width:32%;}
#weixin-compete > .main .detail dl dd div span{font-size:22px;display:block;line-height: 30px;}


.newlist{}
.newlist ul li{margin-bottom:30px;background-color:#F0F0F0;padding:10px;}
.newlist ul li img{float:left;width:94px;height:94px;}
.newlist ul li .info{margin-left:119px;padding-right:40px;}
.newlist ul li .info h3 {}
.newlist ul li .info h3 a{width:410px;line-height:30px;font-size:16px;font-weight: bold;color:#121212;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;display:block;}
.newlist ul li .info p{line-height:24px;height:50px;color:#999;}
.newlist ul li .nt{text-align: right;}


</style>
<script src="<?=n_js('weixin','cac')?>"></script>

<?php
$wxDetail = $data['wxDetail'];
?>
<div id="weixin-compete" class="n-max-width n-middle">
	<div class="left">
		<?php
		$m = n_mod('weixin');
		$m->lines();
		?>
	</div>
	<div class="right">
		<?php
		$t = n_mod('weixin');
		$t->commend();
		?>
		<?php n_mod('weixin')->competeList();?>
	</div>
	<div class="main">
		<div style="background-color:#3E3471;padding:20px;margin-top:20px;">
			<div style="background-color: #fff;">
			
				<div id="chart" style="height:360px;padding-top:20px;">
				</div>
			</div>
		</div>


		<div class="big-t">
			<div class="wxinfo">
				<img style="border-radius:55px;width:60px;" src="<?php
						if ($wxDetail['flag'] == 0)
							echo get_weixin_face($wxDetail['face_wxid'], 'png');
						else
							echo get_weixin_face($wxDetail['wxid']);
				 ?>" />
				<!-- <img style="border-radius:55px;width:110px;" src="/static/weixin_face/<?=$wxDetail['wxid']?>.jpg" /> -->
				<span><?=$wxDetail['wxname']?></span>
			</div>
			<div class="wxext">
				<!--b>认证：</b--><?=$wxDetail['auth']?><br /><br />
				<!--b>简介：</b--><?=$wxDetail['description']?>

				<span style="display: block;text-align:right;font-weight: bold;">
					<?php if (in_array($wxDetail['wxid'], $data['cart'])):?>
						<a class="mpadd" href="javascript:void(0);" wxid="<?=$wxDetail['wxid']?>">
							<img src="<?=n_img('skin','heat-on.png')?>" />
							收藏
						</a>
					<?php else:?>
						<a class="mpadd add" href="javascript:void(0);" wxid="<?=$wxDetail['wxid']?>">
							<img src="<?=n_img('skin','heat-off.png')?>" />
							收藏
							</a>
					<?php endif;?>
					　　　　
					<a class="mpdiff" href="javascript:void(0);" wxid="<?=$wxDetail['wxid']?>" onclick="add('<?=$wxDetail['wxid']?>','<?=get_weixin_face($wxDetail['wxid'], 'jpg')?>','<?=$wxDetail['wxname']?>')">
					加入对比</a>
				</span>
			</div>

		</div>
		<!--div class="func" style="height:36px;padding:26px;">
			ooo
		</div-->

		
		<div class="detail">
			<dl>
				<dt>总计</dt>
				<dd class="orange">
					<div><span><?=round(array_sum($data['compete1']['weixin_index'])/7)?></span>中指数</div>
					<div><span><?=round(array_sum($data['compete1']['average_read_num'])/7)?></span>平均阅读数</div>
					
					<div><span><?=round(array_sum($data['compete1']['all_read_num'])/7)?></span>总阅读数</div>
					<div><span><?=round(array_sum($data['compete1']['head_read_num'])/7)?></span>头条阅读数</div>
					<div><span><?=round(array_sum($data['compete1']['max_read_num'])/7)?></span>最高阅读数</div>
					<div><span><?=round(array_sum($data['compete1']['all_like_num'])/7)?></span>点赞数</div>
				</dd>
			</dl>

		</div>
		
		
		
		<h4 style="color:#3E3470;line-height:50px;font-size:22px;padding-left:30px;margin-top:50px;">公号文章</h4>
		<div class="n-box">
			<dl>
				<dt></dt>
			</dl>
		</div>
		<div class="newlist">
			<ul>
				<?php
				$alist = $data['wxList'];

				foreach($alist as $key=>$val){

				?>
				<li>
					<img src="<?=get_weixin_thumbnail($val['articleId'])?>" />
					<div class="info">
						
						<H3>
							<a href="<?=$val['contentUrl']?>" target="_blank"><?=$val['title']?></a>
						</H3>
						<p><?=n_api('article')->subtxt($val['digest'])?></p>
	
						<div class="nt">
							阅读:<?=$val['readNum']?>　
							点赞:<?=$val['likeNum']?>　
							日期:<span class="ptime"><?=date('Y.m.d', $val['ptime'])?></span>
						</div>
					</div>
				</li>
				<?php
				}
				?>
			</ul>
		</div>		
		
		
		
		
		
	</div>
</div>

<script>



option = {
    title : {
        text: '',
        subtext: '中指数'
    },
    tooltip : {
        trigger: 'axis'
    },
    legend: {
        data:['<?=$wxDetail['wxname']?>']
    },

    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : <?=json_encode(array_keys($data['compete1']['weixin_index']))?>
        }
    ],
    yAxis : [
        {
            type : 'value',
            scale:true
        }
    ],
    series : [
        {
            name:'<?=$wxDetail['wxname']?>',
            type:'line',
            data:[11, 11, 15, 13, 12, 13, 10],
            markPoint : {
                data : [
                    {type : 'max', name: '最大值'},
                    {type : 'min', name: '最小值'}
                ]
            }/*,
            markLine : {
                data : [
                    {type : 'average', name: '平均值'}
                ]
            }*/
        }
    ]
};




</script>



<script type="text/javascript">
var myChart1;
	require.config({
		paths: {
			echarts: '/charts/js'
		}
	});
	require(
		[
		'echarts',
		'echarts/chart/bar',
		'echarts/chart/line'
		],
		function (ec) {
			myChart1 = ec.init(document.getElementById('chart'));
			//myChart1.setOption(option);
			zzbIndex();

		}
	);
function zzbIndex(){
	option.title.subtext = "中指数";
	option.series[0].data = <?=json_encode(array_values($data['compete1']['weixin_index']))?>;
	
	myChart1.setOption(option);
}
function totalRead(){
	option.title.subtext = "总阅读数";
	option.series[0].data = <?=json_encode(array_values($data['compete1']['all_read_num']))?>;
	
	myChart1.setOption(option);
}
function avgRead(){
	option.title.subtext = "平均阅读数";
	option.series[0].data = <?=json_encode(array_values($data['compete1']['average_read_num']))?>;
	
	myChart1.setOption(option);
}
function toutiaoRead(){
	option.title.subtext = "头条阅读数";
	option.series[0].data = <?=json_encode(array_values($data['compete1']['head_read_num']))?>;
	
	myChart1.setOption(option);
}
function topRead(){
	option.title.subtext = "最高阅读数";
	option.series[0].data = <?=json_encode(array_values($data['compete1']['max_read_num']))?>;
	
	myChart1.setOption(option);
}
function zhang(){
	option.title.subtext = "点赞数";
	option.series[0].data = <?=json_encode(array_values($data['compete1']['all_like_num']))?>;
	
	myChart1.setOption(option);
}
</script>


<div id="tips" style="width:480px;height:300px;border-radius: 5px;background-color:#34454D;display:none;position:absolute;text-align: center;">
	<div style="margin-top:88px;">
		<a class="n-btn-blue" href="/passport/login.html">请您登录</a>
	</div>
	<div style="margin-top:15px;">
		<a class="n-btn-blue" href="javascript:void(0);" onclick="tips.close();">返　回</a>
	</div>
</div>